package com.kaishengit.web;


import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.kaishengit.entity.Document;
import com.kaishengit.entity.UserProject;
import com.kaishengit.service.DocumentService;

public class DocumentShowServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		HttpSession session=request.getSession();
		UserProject userProject=(UserProject) session.getAttribute("userProject");
		
		String id=request.getParameter("id");
		DocumentService service=new DocumentService();
		Document document=service.findById(id);
		
		
		request.setAttribute("document", document);
		request.getRequestDispatcher("/WEB-INF/views/document_show.jsp").forward(request, response);
	}

}
